#include<stdio.h>
#include<string.h>
char *s_gets(char *st,int n);
#define Maxtitle 41
#define Maxauthor 31
struct book
{
    char title[Maxtitle];
    char author[Maxauthor];
    float value;

};
int main(void)
{
    struct book library;

    printf("Please enter the book title\n");
    s_gets(library.title,Maxtitle);
    printf("Now enter the author name\n ");
    s_gets(library.title,Maxauthor);
    printf("Please enter the value of book\n");
    scanf("%f",&library.value);
    printf("%s by %s :$%.2f\n",library.title,library.author,library.value);
    printf("Done.\n");
    return 0;

}
char *s_gets(char *st,int n)
{
    char *ret_val;
    char *find;
    ret_val=fgets(st,n,stdin);
    if(ret_val)
    {
        find=strchr(st,'\n');
        if(find)
            *find='\0';
        else
            while(getchar()!='\n')
                continue;
    }
    return ret_val;
}